package com.jintian.smart.base.api.security.entity;

import com.jintian.smart.kernel.core.domain.IEntity;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.beetl.sql.annotation.builder.FillStrategy;
import org.beetl.sql.annotation.builder.UpdateTime;
import org.beetl.sql.annotation.entity.AssignID;
import org.beetl.sql.annotation.entity.Table;

import java.time.LocalDateTime;

/**
 * 登录失败记录
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "sec_log_login_fail")
public class LoginFailEntity implements IEntity {
    @AssignID("snowid")
    private Long loginFailId;

    /**
     * 用户id
     */
    private Long userId;

    /**
     * 用户类型
     */
    private Integer userType;

    /**
     * 登录名
     */
    private String loginName;

    /**
     * 锁定状态
     */
    private Integer lockFlag;

    /**
     * 登录失败次数
     */
    private Integer loginFailCount;

    /**
     * 连续登录失败锁定开始时间
     */
    private LocalDateTime loginLockBeginTime;

    @UpdateTime(FillStrategy.INSERT_UPDATE)
    private LocalDateTime updateTime;

    @UpdateTime(FillStrategy.INSERT)
    private LocalDateTime createTime;
}
